package com.fwj.authorization.staff.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fwj.authorization.staff.entity.SysMenu;
import com.fwj.authorization.staff.mapper.SysMenuMapper;
import com.fwj.authorization.staff.service.SysMenuService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * SysMenuServiceImpl
 *
 * @author 樊温军
 * @date 2025/3/22 下午4:34
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService {
    @Override
    public IPage<SysMenu> getPage(Page<SysMenu> page, SysMenu sysMenu) {
        return baseMapper.getPage(page, sysMenu);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public Boolean saveMenu(List<SysMenu> sysMenus) {
        return this.saveOrUpdateBatch(sysMenus);
    }
}
